package com.wz.wzliving.commodity.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.wzcommon.valid.*;
import com.wzcommon.valid.SaveGroup;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * 家居品牌
 * 
 * @author wangzeng
 * @email 3107187288@qq.com
 * @date 2025-03-27 09:42:24
 */
@Data
@TableName("commodity_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@TableId
	@NotNull(message = "修改要求指定id", groups = {UpdateGroup.class})
	@Null(message = "添加不能指定id", groups = {SaveGroup.class})
	@NotNull(message = "测试isshow", groups = {UpdateIsShowGroup.class})
	private Long id;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名不能为空",groups = {UpdateGroup.class,SaveGroup.class})
	private String name;
	/**
	 * logo
	 */
	@NotBlank(message = "logo 不能为空",groups = {SaveGroup.class})
	@URL(message = "logo 不是一个合法的 url",groups = {UpdateGroup.class,SaveGroup.class})
	private String logo;
	/**
	 * 说明
	 */
	private String description;
	/**
	 * 显示
	 */
	@NotNull(message = "显示状态不能为空",groups = {SaveGroup.class})
	@EnumValidate(values = {0,1},message = "必须是0或1",groups = {UpdateGroup.class,SaveGroup.class,UpdateIsShowGroup.class})
	private Integer isshow;
	/**
	 * 检索首字母
	 */
	@NotBlank(message = "检索字母不能为空",groups = {SaveGroup.class})
	@Pattern(regexp="^[a-zA-Z]$",message = "检索字母必须是一个字母",groups = {SaveGroup.class})
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull(message = "排序值不能为空",groups = {UpdateGroup.class,SaveGroup.class})
	@Min(value = 0,message = "排序值要求大于等于 0",groups = {UpdateGroup.class,SaveGroup.class})
	private Integer sort;

}
